UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u0mZwRGODEh9/PENDuBwZoAg4y1eyQxkPXd5QbjNh9I=' 
WHERE 
  key_id = 'c9cf3b6b7414850352ac03b58e4fffdae76a4f052a15c54980e44c088b0d0769' 
  AND (
    token = 'u0mZwRGODEh9/PENDuBwZoAg4y1eyQxkPXd5QbjNh9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024