UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QZ2akDUZA/yEES/M5P2NaPClDwPVhx0qr91q64Gp0Sw=' 
WHERE 
  key_id = '94e522242e4e67b4bc48ed477ace103917fcbb56445374b6efea8a64a9f313af' 
  AND (
    token = 'QZ2akDUZA/yEES/M5P2NaPClDwPVhx0qr91q64Gp0Sw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045