UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kpsgevUWP2XJ3e6BxKereXN9lwwwSBQQxJEcjuSQJd0='
WHERE
key_id = 'b87dd6898d47875078fbd31880b4c5d39be5daeaa279e51ef6208f25d0cd8483'
AND (
token = 'kpsgevUWP2XJ3e6BxKereXN9lwwwSBQQxJEcjuSQJd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)