UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uHMuW5vJHdiSl8IuVjJR4mLZFIdYBMWaOXiHKHdFHJ0=' 
WHERE 
  key_id = '8f2406e04adb1db06b12bf8fdc1d5986b24d448a1eb5d875a5e8b37991ea90cc' 
  AND (
    token = 'uHMuW5vJHdiSl8IuVjJR4mLZFIdYBMWaOXiHKHdFHJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034