UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R1NwFjsrGl7KlpRET3xYGGk4MOp+t5DwrcjExaiXg8s='
WHERE
key_id = '57d73908ed8ad59ca4b6366c2d126a33ce15280c69119c97e67980d4c7be6e66'
AND (
token = 'R1NwFjsrGl7KlpRET3xYGGk4MOp+t5DwrcjExaiXg8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)