UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rL/iVg0EakZ7/9hjkzMe1tsKqO6I8R1VIgt9/SZd/Uc=' 
WHERE 
  key_id = '41ad2a590b5b3cfae4c8ac25dcf2293d185e9054182a8ef6815a57b23b933fed' 
  AND (
    token = 'rL/iVg0EakZ7/9hjkzMe1tsKqO6I8R1VIgt9/SZd/Uc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028