UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'huxrqE11xmBVw11zEWazDQfUnsi0ILKHWHS7lOdFBFI='
WHERE
key_id = '0c18401e0c237fa6f2d9050adbadca2d72d38ad8410b808d0c0e6301f6d722cd'
AND (
token = 'huxrqE11xmBVw11zEWazDQfUnsi0ILKHWHS7lOdFBFI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)