UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kVwEu2nfb3/DEKnjh8DTG7wgvvBOUVtYEHTtlwFJav8='
WHERE
key_id = '2013069e0072bfe27b3bff0aee03aaea3079e4fb19b5b9658c780b780c4a3d4a'
AND (
token = 'kVwEu2nfb3/DEKnjh8DTG7wgvvBOUVtYEHTtlwFJav8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)