UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mRI8DLAtUjEQd46Jvj3qqk0C5A17/2SrDARXFmsRhKU=' 
WHERE 
  key_id = '9f2e889795fa25023c3fb078599027100a38fc642c8eb86ef142d918acecec96' 
  AND (
    token = 'mRI8DLAtUjEQd46Jvj3qqk0C5A17/2SrDARXFmsRhKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030