UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pnq03yk3cAzxCfaeP7lDH9/Eic4DHxmrJ5sN3NTe3DY=' 
WHERE 
  key_id = 'bd2d785dbc56b9ff2fb85cb752cf7ab3dcdec82983a09319b09cdd46b59e2627' 
  AND (
    token = 'Pnq03yk3cAzxCfaeP7lDH9/Eic4DHxmrJ5sN3NTe3DY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030