UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lur8nX49CAUMMBW1RqEIvSxt1FH5qk6qg9gu6PhEP+4='
WHERE
key_id = '33724abdd2dab37786a809ea5491726dbfd2a21373d098446379f916ddd94980'
AND (
token = 'lur8nX49CAUMMBW1RqEIvSxt1FH5qk6qg9gu6PhEP+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)