UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GJm7QoLAD7sPxvFtIw+u3jn3nUfNXZgINUeMlElvrHc='
WHERE
key_id = 'b1bd06cdcde23bfe08e555a4e087ddc817ecc55a314037ce8ece6b7164209c31'
AND (
token = 'GJm7QoLAD7sPxvFtIw+u3jn3nUfNXZgINUeMlElvrHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)