UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OvLTp/sNjssU9WsXIKk4WuP8zd8uoI/pdrDgDQUzhCg='
WHERE
key_id = 'd4bc3f8813fd2f984c181092278e176faa1fcb97ecb5f870790a1ab283e3ad45'
AND (
token = 'OvLTp/sNjssU9WsXIKk4WuP8zd8uoI/pdrDgDQUzhCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)