UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hrch9HjxqcRGRTSNj4O53d2uLo/3uy9nPCiJkq+yxlM=' 
WHERE 
  key_id = '5e1f9adce4cf4a93b98bfeea37d88af400290d010cbe58f637ed0a3240da1cdf' 
  AND (
    token = 'hrch9HjxqcRGRTSNj4O53d2uLo/3uy9nPCiJkq+yxlM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025