UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WWmu3p2G5QYc8GrOz5DQiyOUcoXAcbMajuCenQR8RtY=' 
WHERE 
  key_id = 'c3e974d116c1328c22fa99c9bfd267d575c4df1134f74bb2c21e34e4d433e534' 
  AND (
    token = 'WWmu3p2G5QYc8GrOz5DQiyOUcoXAcbMajuCenQR8RtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036