UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9tcPbcqt9GcC5AS1kQrOI2bCq8AID5ZDGR4LWS64Mcw=' 
WHERE 
  key_id = '6f764b7d162ce938da003ba037f4cc31311bc0f6b210d0dae3ba0915783e2b12' 
  AND (
    token = '9tcPbcqt9GcC5AS1kQrOI2bCq8AID5ZDGR4LWS64Mcw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029