UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vi9eaA+3vTiOJAkunBSqcgMeBkUPm4AXK6mhsWJffZA=' 
WHERE 
  key_id = 'c67f433fdc378ab1c97da4f8da3c7b3db8dd316b33253ad3a8339a7652710e88' 
  AND (
    token = 'vi9eaA+3vTiOJAkunBSqcgMeBkUPm4AXK6mhsWJffZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022