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