UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '50Rb/I3G77U3FiJZ9ltY8oj2miWFiXu+CZ5AnNSdryA=' 
WHERE 
  key_id = '568c1fe255119e9e13fcddc225a00ad651bd58ea102c6b1d3da15bff0228bd03' 
  AND (
    token = '50Rb/I3G77U3FiJZ9ltY8oj2miWFiXu+CZ5AnNSdryA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00082