UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kLH6hHzQhBqR0FoPA8qDupOg9mZf2iiwKrzGmoVVYDY='
WHERE
key_id = '37507a32fadf6d2165ccda070e922841922c1140c3d3dc721f2145c57297fcda'
AND (
token = 'kLH6hHzQhBqR0FoPA8qDupOg9mZf2iiwKrzGmoVVYDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)