UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y5HhQFI8tWSFVME7sOSumI+FaKqt+Tl/k9aLKKX17eU='
WHERE
key_id = 'ff6770e62ab2957bbdf047c96462e541909a1153a4cff046d2ff08fafb4595a5'
AND (
token = 'Y5HhQFI8tWSFVME7sOSumI+FaKqt+Tl/k9aLKKX17eU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)