UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hP/TFZpobb9nSJvSYIm+7NMJQfq2d7ugE2Oh4UOqINY='
WHERE
key_id = '2adc7bb749ff6c04ad1b3e5835d57202dd104730d627b5ead6659704fb8fceea'
AND (
token = 'hP/TFZpobb9nSJvSYIm+7NMJQfq2d7ugE2Oh4UOqINY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)