UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c9xQKq+778b2cN3hxWiM1oo3Uz16ULlOtQiIqQUKlFY=' 
WHERE 
  key_id = '32186c9b3298c418aec9f1706c5f526becef4059fd9fc2784956012a63bf7dad' 
  AND (
    token = 'c9xQKq+778b2cN3hxWiM1oo3Uz16ULlOtQiIqQUKlFY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031