UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Ci6jjql6PHH2hAoxFI9RBCX2XCS/tXWslmhEIw9XSI='
WHERE
key_id = '4d420344abcb087922628cb33882cdee8f27074a16433a1b83a568aa5d5d395c'
AND (
token = '/Ci6jjql6PHH2hAoxFI9RBCX2XCS/tXWslmhEIw9XSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)