UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C0SUm4Sy9PHxXVKaC+TV5mNDfanpA/p3P2Cp7sx9EF4=' 
WHERE 
  key_id = '35313eeadbe1d6de06cefa7170d4c99391768f032f11c45ba6d2e78e289f2298' 
  AND (
    token = 'C0SUm4Sy9PHxXVKaC+TV5mNDfanpA/p3P2Cp7sx9EF4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058