UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qfbvFZ3dSy3B/HMVsVlTBMAOD1lnc6wL/e56Q/b8Nc4=' 
WHERE 
  key_id = '263dae00069174e9041d465285cd8e8c2abaa92283dbc2eeab66b6df8e11e001' 
  AND (
    token = 'qfbvFZ3dSy3B/HMVsVlTBMAOD1lnc6wL/e56Q/b8Nc4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033