UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K/h56BPzTDnUWKdAV5e1Y8VwBK8gGmbc85TzRr2mg+0='
WHERE
key_id = 'ee0a4c62c2f47c74436ea8a1715b2ab4ef62e5852f9a2b75ab4474070bd68010'
AND (
token = 'K/h56BPzTDnUWKdAV5e1Y8VwBK8gGmbc85TzRr2mg+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)