UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QqhcNCxn3RJWR0OfooBgS9a+mN+gKorq82bw8NsrLiE='
WHERE
key_id = '34179816b87f80a38aa41e6d3dda873b680d7db101de96729a8aa5e24bf64fc9'
AND (
token = 'QqhcNCxn3RJWR0OfooBgS9a+mN+gKorq82bw8NsrLiE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)