UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WTVOk+82jjejtn40p1IMAi0gp6dpP+BHE49H6lxsyrE=' 
WHERE 
  key_id = '070f53b38739e2424f5380da4615156306208030204362b11815ae65598e83f2' 
  AND (
    token = 'WTVOk+82jjejtn40p1IMAi0gp6dpP+BHE49H6lxsyrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044